﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NS.BLL.Systems;

public partial class Systems_MenuModify : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            DataShow();
        }
    }
    private void DataShow()
    {
        NS.Model.Systems.Menu Model = NS.BLL.Systems.MenuService.Select(Convert.ToInt64(Request.QueryString["ID"]));
        if (Model != null)
        {
            txtMenuName.Text = Model.MenuName;
            txtMenuUrl.Text = Model.MenuLink;
            txtOrderID.Text = Model.OrderID.ToString();
        }
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (UtilityService.UpdateFieldByPK("Menu", "MenuName,MenuLink,OrderID", new Object[] { txtMenuName.Text.Trim(), txtMenuUrl.Text.Trim(), txtOrderID.Text.Trim() }, "MenuID", Request.QueryString["ID"]) > 0)
        {
            NS.Utilities.MessageBox.AppendScript(this, "$(':input[id$=\"btnBindData\"]', window.parent.document.body).click();");
        }
    }
}